package Service.impl;

import Dao.UserDao;
import Dao.impl.UserDaoimpl;
import Service.UserService;
import pojo.Admin;

/**
 * @author LiangHaiBo
 * @version 1.0
 * @date 2021.8.27 下午 16:11
 */
public class UserServiceimpl implements UserService {

    @Override
    public void Regis(String name,String password) {
        UserDao userDao = new UserDaoimpl();
        userDao.Regis(name,password);
    }

    @Override
    public boolean getUser(String name, String password) {

        UserDao userDao = new UserDaoimpl();

        Admin admin = userDao.selectUserByName(name);

        if(admin != null){

            String pwd = admin.getPassword();
            if(password.equals(pwd)){
                return true;
            }
        }
        return false;
    }
}
